export type RepoContributorsApi = {
    login: string;
    id: number;
    node_id: string;
    avatar_url: string;
    gravatar_id: string;
    url: string;
    html_url: string;
    followers_url: string;
    following_url: string;
    gists_url: string;
    starred_url: string;
    subscriptions_url: string;
    organizations_url: string;
    repos_url: string;
    events_url: string;
    received_events_url: string;
    type: string;
    site_admin: boolean;
    contributions: number;
};

export type RepoContributorsModel = {
    login: string;
    id: number;
    avatarUrl: string;
    htmlUrl: string;
};

export const normalizeRepoContributors = (from: RepoContributorsApi[]): RepoContributorsModel[] =>
    from.map((elem) => ({
        ...elem,
        htmlUrl: elem.html_url,
        avatarUrl: elem.avatar_url,
    }));
